package com.aozhi.aipower.operation.util;

import cn.org.atool.generator.FileGenerator;
import cn.org.atool.generator.annotation.Table;
import cn.org.atool.generator.annotation.Tables;

/**
 * FluentMybatis 实体类生成工具
 * @author lunzi
 */
public class EntityGeneratorUtil {
    public static final String URL = "jdbc:mysql://10.5.9.183:3306/aipower?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&allowMultiQueries=true";
    public static final String USERNAME = "root";
    public static final String PASSWORD = "AIpower123!@#";

    public static void main(String[] args) throws Exception {
        FileGenerator.build(Empty.class);
    }

    @Tables(
            // 设置数据库连接信息
            url = URL,
            username = USERNAME,
            password = PASSWORD,
            // 表前缀
            tablePrefix = {"t_"},
            // 设置entity类生成src目录, 相对于 user.dir
            srcDir = "src/main/java",
            // 设置entity类的package值
            basePack = "com.aozhi.aipower.operation",
            // 设置dao接口和实现的src目录, 相对于 user.dir
            daoDir = "src/main/java",
            // 设置哪些表要生成Entity文件
            tables = {
                    @Table(value = {
                            // "t_aipower_new_product",
                            "t_banner",
                            "t_product",
                            "t_information_read",
                            "t_information_like",
                            "t_information_comment",
                            "t_information",
                    })
            }
    )
    static class Empty {
    }
}
